package showtime.framework.ui
{
	import flash.display.DisplayObjectContainer;
	
	public class Button extends UIComponent
	{
		protected var _label:Label = null;
		protected var _labelText:String = null;
		
		public function Button(parent:DisplayObjectContainer = null, xpos:Number = 0, ypos:Number = 0, label:String = "", skinClass:Class = null)
		{
			_labelText = label;
			
			super(parent, xpos, ypos);	
		}
		
		override protected function initialize():void
		{
			super.initialize();
		}
		
		override protected function createChildren():void
		{
			super.createChildren();
			
			_label = new Label(this, 0, 0, _labelText);			
		}

		override public function updateDisplayList():void
		{
			super.updateDisplayList();
			
			_label.updateDisplayList();
			
			_label.move(width * 0.5 - _label.width * 0.5, height * 0.5 - _label.height * 0.5);
			
		}
		public function set label(value:String):void
		{
			_labelText = value;
		}
		
		public function get label():String
		{
			return _labelText;
		}
		
		
	}
}